<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="Mosaddek">
    <meta name="keyword" content="FlatLab, Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">
    <link rel="shortcut icon" href="img/favicon.html">

    <title></title>

    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/bootstrap-reset.css" rel="stylesheet">
    <!--external css-->
    <link href="assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <!-- Custom styles for this template -->
    <link href="css/style.css" rel="stylesheet">
    <link href="css/style-responsive.css" rel="stylesheet" />

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 tooltipss and media queries -->
    <!--[if lt IE 9]>
      <script src="js/html5shiv.js"></script>
      <script src="js/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>

  <section id="container" class="">
      <!--header start-->
      <header class="header white-bg">
              <div class="sidebar-toggle-box">
                  <div data-original-title="" data-placement="right" class="icon-reorder tooltips"></div>
              </div>
              <!--logo start-->
              <a href="#" class="logo">车辆<span>管理系统</span></a>
              <!--logo end-->
             
              <div class="top-nav ">
                  <ul class="nav pull-right top-menu">
                     <!--  <li>
                         <input type="text" class="form-control search" placeholder="搜索">
                     </li> -->
                      <li class="dropdown">
                        <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                            <img alt="" src="img/avatar1_small.jpg">
                            <span id="name" class="username"></span>
                            <b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu extended logout">
                            <div class="log-arrow-up"></div>
                            <!-- <li><a href="#"><i class=" icon-suitcase"></i>个人资料</a></li> -->
                            <!-- <li><a href="ownerManagement.html"><i class="icon-cog"></i>设置</a></li> -->
                            <!-- <li><a href="#"><i class="icon-bell-alt"></i> 通知</a></li> -->
                            <li><a href="login.html"><i class="icon-key"></i> 退出</a></li>
                        </ul>
                    </li>
                  </ul>         
              </div>
        </header>
      <!--header end-->
      <!--sidebar start-->
      <aside>
          <div id="sidebar"  class="nav-collapse ">
              <!-- sidebar menu start-->
              <ul class="sidebar-menu">
                  <li class="">
                      <a class="" href="index.html">
                          <i class="icon-dashboard"></i>
                          <span>首页</span>
                      </a>
                  </li>
                  <li class="sub-menu">
                      <a href="javascript:;" class="">
                          <i class="icon-book"></i>
                          <span>车辆基本信息管理</span>
                          <span class="arrow"></span>
                      </a>
                      <ul class="sub">
                          <li><a class="" href="carList.html">车辆列表</a></li>
                          <li><a class="" href="addCar.html">新增车辆</a></li>
                      </ul>
                  </li>
                  <li class="sub-menu">
                      <a href="javascript:;" class="">
                          <i class="icon-cogs"></i>
                          <span>车主信息管理</span>
                          <span class="arrow"></span>
                      </a>
                      <ul class="sub">
                          <li><a class="" href="carOwnerList.html">车主列表</a></li>
                          <li><a class="" href="addCarOwner.html">新增车主</a></li>  
                      </ul>
                  </li>
                  <li class="sub-menu">
                      <a href="javascript:;" class="">
                          <i class="icon-tasks"></i>
                          <span>车辆管理费</span>
                          <span class="arrow"></span>
                      </a>
                      <ul class="sub">
                          <li><a class="" href="feeList.html">费用列表</a></li>
                          <li><a class="" href="chargeMoney.html">收取管理费</a></li>
                      </ul>
                  </li>
                  <li class="sub-menu">
                      <a href="javascript:;" class="">
                          <i class="icon-th"></i>
                          <span>车辆变更管理</span>
                          <span class="arrow"></span>
                      </a>
                      <ul class="sub">
                          <li><a class="" href="carTransferList.html">车辆变更列表</a></li>
                          <li><a class="" href="addCarTransfer.html">新增车辆变更</a></li>
                      </ul>
                  </li>
               
                  <li class="sub-menu active">
                      <a href="javascript:;" class="">
                          <i class="icon-glass"></i>
                          <span>系统管理</span>
                          <span class="arrow"></span>
                      </a>
                      <ul class="sub">
                          <li><a class="" href="queryOwner.html">查看用户</a></li>
                          <li class="active"><a class="" href="ownerManagement.html">用户管理</a></li>
                          <li><a class="" href="quit.html">安全退出</a></li>
                      </ul>
                  </li>
                  <li>
                      <a class="" href="login.html">
                          <i class="icon-user"></i>
                          <span>登录</span>
                      </a>
                  </li>
              </ul>
              <!-- sidebar menu end-->
          </div>
      </aside>
      <!--sidebar end-->
      <!--main content start-->
      <section id="main-content">
          <section class="wrapper">
              <!-- page start-->
              <div class="row">
                  <aside class="profile-nav col-lg-3">
                      <section class="panel">
                          <div class="user-heading round">
                              <a href="#">
                                  <img src="img/profile-avatar.jpg" alt="">
                              </a>
                              <h1 id="name">Jonathan Smith</h1>
                              <p>欢迎来到个人中心</p>
                          </div>

                          <ul class="nav nav-pills nav-stacked">
                              <li class="active"><a href="ownerManagement.html"> <i class="icon-user"></i> 个人信息修改</a></li>
                              <li><a href="#"> <i class="icon-calendar"></i> 近期活动 <span class="label label-danger pull-right r-activity">9</span></a></li>
                              <li><a href="profile-edit.html"> <i class="icon-edit"></i> 添加新用户</a></li>
                          </ul>

                      </section>
                  </aside>
                  <aside class="profile-info col-lg-9">
                   
                      <section class="panel">
                          <div class="bio-graph-heading">
                             修改个人密码
                          </div>
                          <div class="panel-body bio-graph-info">
                        
                              <form role="form" class="form-horizontal" style="margin:20px">
                           
                                <div class="form-group">
                                    <label class="col-lg-2 control-label" for="username">用户名</label>
                                    <div class="col-lg-10">
                                        <input type="text" class="form-control" id="username" required="required"/><!--  -->
                                    </div>  
                                </div>
                                <div class="form-group">
                                    <label class="col-lg-2 control-label" for="oldpassword">原密码</label>
                                    <div class="col-lg-10">
                                        <input type="password" class="form-control" id="oldpassword" required="required"/><!--  -->
                                    </div>  
                                </div>
                                <div class="form-group">
                                    <label class="col-lg-2 control-label" for="newpassword">新密码</label>
                                    <div class="col-lg-10">
                                        <input type="password" class="form-control" id="newpassword" required="required"/><!--  -->
                                    </div>  
                                </div>
                                <div class="form-group">
                                    <label class="col-lg-2 control-label" for="checkpassword">再输入一次</label>
                                    <div class="col-lg-10">
                                        <input type="password" class="form-control" id="checkpassword" required="required"/><!--  -->
                                    </div>  
                                </div>

                                <div class="form-group">
                                  
                                    <div class="col-lg-6">
                                       <button class="btn btn-primary" id="sub">修改</button>
                                    </div>
                                   
                                    <div class="col-lg-6">
                                      <button class="btn btn-default" type="reset">返回</button>
                                    </div>
                                </div>
                            </form>
                          </div>
                      </section>
                    
                  </aside>

              </div>

              <!-- page end-->
          </section>
      </section>
      <!--main content end-->
  </section>

    <!-- js placed at the end of the document so the pages load faster -->
    <script src="js/jquery.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/jquery.scrollTo.min.js"></script>
    <script src="js/jquery.nicescroll.js" type="text/javascript"></script>
    <script src="assets/jquery-knob/js/jquery.knob.js"></script>

    <!--common script for all pages-->
    <script src="js/common-scripts.js"></script>

  <script type="text/javascript">

       //插入后台返回的用户名
	    $(document).ready(function(){
	    	var data = JSON.parse(sessionStorage.getItem("mess"));
	    	$("#name").html(data.name);
		}) 

      //knob
      $(".knob").knob();
       	   	    
		$("#sub").click(function(){
			 var username = $('#username').val(),
			    oldpassword = $('#oldpassword').val(),
			    newpassword = $('#newpassword').val(),
			    checkpassword = $('#checkpassword').val();
			 
			if(newpassword != checkpassword){
				alert("两次输入的密码不一致，请重新输入！");
				$("input[id='newpassword']").val("");
				$("input[id='checkpassword']").val("");
				return false;
			}else{
				var datalist = [{
						username: username,
						password: oldpassword
					}];
				var t = JSON.stringify(datalist);
				$.ajax({
					async: false,
					url: 'user_query.action',
					type: 'POST',
					dataType: 'json',
					data: "data=" + t,

					success: function(data) {
						if(data.code ==  1){
							var datalist = [{
									username: username,
									password: newpassword
								}];
							var t = JSON.stringify(datalist);
							$.ajax({
								async: false,
								url: 'user_update.action',
								type: 'POST',
								dataType: 'json',
								data: "data=" + t,

								success: function(data) {
									alert(data.data);
									console.log('success');
									return false;
								},

								error: function(data) {
									alert(data.data);
									return false;
								}
							})							
						}else{
							alert("用户名密码不匹配！");
							return false;
						}
						
					}

				})
			}
		});
	    
	    
  </script>


  </body>
</html>
